//
//  KKSendArticleDialog.m
//  DoMi
//
//  Created by 康凯 on 2016/12/5.
//  Copyright © 2016年 kk. All rights reserved.
//

#import "KKSendArticleDialog.h"

@implementation KKSendArticleDialog

-(void)awakeFromNib{
    [super awakeFromNib];
    self.frame = [UIScreen mainScreen].bounds;
    self.containerBottom.constant=-268;
    [self layoutIfNeeded];
    self.backgroundColor=[UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
}

#pragma makr 弹框--展示
-(void)show{
    [appWindow addSubview:self];
    [UIView animateWithDuration:dialog_animation_time animations:^{
        self.containerBottom.constant=8;
        [self layoutIfNeeded];
    }];
}
#pragma makr 弹框--消失
-(void)dismiss{
    [UIView animateWithDuration:dialog_animation_time animations:^{
        [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
        self.containerBottom.constant=-268;
        [self layoutIfNeeded];
    } completion:^(BOOL finished) {
        [self removeFromSuperview];
    }];
}

- (IBAction)backClick:(id)sender {
    [self dismiss];
    self.dismissBlock();
}

@end
